var fs = require("fs");
var packageJson =  require("./package.json");
var dependencies = packageJson.devDependencies;
var cont = `cmd /c npm install -g cnpm --registry=https://registry.npm.taobao.org
cmd /c cnpm install gulp-cli -g\n`;
var link = `@ECHO OFF
cd /d "%~dp0"\n`;
for(plugin in dependencies){
	cont += "cmd /c cnpm install " + plugin + "@" + dependencies[plugin].replace("^", '') + " -g\n";
	link += "cmd /c cnpm link " + plugin + " \n";
}
fs.writeFile("./install-global.cmd", cont, function (error) {
	if(error) {
		console.log(error);
	}
});


fs.writeFile("./link-global.cmd", link, function (error) {
	if(error) {
		console.log(error);
	}
});